import request from '@/config/axios'

// 账户记录 VO
export interface AccountRecordVO {
  id: number // ID
}

// 账户记录 API
export const AccountRecordApi = {
  // 查询账户记录分页
  getAccountRecordPage: async (params: any) => {
    return await request.get({ url: `/wo/account-record/page`, params })
  },

  // 查询账户记录详情
  getAccountRecord: async (id: number) => {
    return await request.get({ url: `/wo/account-record/get?id=` + id })
  },

  // 新增账户记录
  createAccountRecord: async (data: AccountRecordVO) => {
    return await request.post({ url: `/wo/account-record/create`, data })
  },

  importAccount: async (file: File, busId) => {
    return await request.post({
      url: `/wo/account-record/import`,
      data: {
        file: file,
        busId
      },
      headersType: 'multipart/form-data'
    })
  },

  // 修改账户记录
  updateAccountRecord: async (data: AccountRecordVO) => {
    return await request.put({ url: `/wo/account-record/update`, data })
  },

  // 删除账户记录
  deleteAccountRecord: async (id: number) => {
    return await request.delete({ url: `/wo/account-record/delete?id=` + id })
  },

  // 导出账户记录 Excel
  exportAccountRecord: async (params) => {
    return await request.download({ url: `/wo/account-record/export-excel`, params })
  }
}
